Skip to content

feat(mcp): --with-output-style auto-activates the style (no manual /style needed)#39

Merged
aomerk merged 1 commit into
mainfrom
feat-auto-activate-output-style
May 1, 2026
Merged

feat(mcp): --with-output-style auto-activates the style (no manual /style needed)#39
aomerk merged 1 commit into
mainfrom
feat-auto-activate-output-style

Conversation

@aomerk

@aomerk aomerk commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

keeba mcp install --with-output-style now also flips outputStyle: \"keeba\" in ~/.claude/settings.json so the style is active on the next Claude Code launch without the user typing any slash command. Closes the UX cliff where the install dropped the file on disk but the style was never actually used.

Why

Real user report from a v2.1.126 session:

❯ /output-style keeba
Unknown command: /output-style

❯ /style keeba
Unknown command: /style

Claude Code v2.x removed (or renamed) the per-session output-style slash command. The settings.json outputStyle key is the only stable activation surface across versions — confirmed by inspecting the binary (outputStyle:OH?.outputStyle in localSettings save path).

Until this PR, --with-output-style left users with a file on disk and no way to activate it. The terse style we shipped in PR #35 + the inter-tool-silence rule in PR #38 did nothing for them.

How

Adds activateKeebaOutputStyle(settingsPath string) (bool, error):

  • Reads existing ~/.claude/settings.json (or starts empty if missing)
  • Sets outputStyle: \"keeba\", preserving every other key
  • Writes back as indented JSON
  • Idempotent: returns (false, nil) if already set to "keeba"

Wired into applyClaudeCodePatches after installKeebaOutputStyle so re-running install prints "no change" cleanly when both halves are already done.

Test plan

  • go test ./internal/cli/... — green (4 new tests: fresh-file, preserves-existing-keys-including-hooks, idempotent, overwrites-different-style)
  • gofumpt -l clean, golangci-lint run 0 issues
  • End-to-end with synthetic HOME:
    • Pre-existing settings.json with theme + effortLevel
    • keeba mcp install --tool claude-code --with-output-style runs
    • Result: {theme, effortLevel, outputStyle: \"keeba\"} — all three preserved
    • Re-run prints "no change" for all install steps

What this means for users

After merge + reinstall:

keeba mcp install --tool claude-code \\
  --patch-agents --with-claude-md --with-hook --with-output-style
# restart Claude Code → terse style is active automatically

No /output-style or /style activation needed. The install is the install.

🤖 Generated with Claude Code

User feedback: "man, keeba install should take care of this honestly"
after their interactive Claude Code session rejected `/output-style
keeba` and `/style keeba` as Unknown commands.

Diagnosis: Claude Code v2.x removed (or renamed) the per-session
output-style slash command. The only stable activation surface across
versions is `outputStyle: "<name>"` in ~/.claude/settings.json. Without
flipping that key, --with-output-style was a UX cliff: the file landed
on disk, the user had no way to activate it, and every session kept
emitting the chatty default style.

Fix: install now does both halves automatically. After dropping
~/.claude/output-styles/keeba.md, it sets outputStyle=keeba in
~/.claude/settings.json, preserving every other key (theme, hooks,
effortLevel — critical because the install just registered the
UserPromptSubmit hook in the same hooks block).

Idempotent on both halves. Re-running prints "no change" for the
file path, the style activation, and the MCP server registration.

Tests: fresh-file creation, preserves-other-keys (with realistic hooks
block), idempotent re-run, overwrites-different-style. End-to-end
install against a synthetic HOME confirms settings.json picks up
outputStyle=keeba while keeping theme + effortLevel + everything else.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aomerk aomerk merged commit e09bb59 into main May 1, 2026
2 checks passed
@aomerk aomerk deleted the feat-auto-activate-output-style branch May 1, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant